﻿Public Class SqlEventArgs
    Inherits EventArgs

    Public Type As EnumSqlEvent = EnumSqlEvent.eNone
    Public Command As SqlCommand = Nothing
    Public Name As String = ""
    Public Message As String = ""
    Public ErrorCode As UInt32 = 0

    Public Sub New()
        Type = EnumSqlEvent.eNone
    End Sub
    Public Sub New(ByVal msg As String, ByVal cmd As SqlCommand)
        Name = "command"
        Message = msg
        Command = cmd
        Type = EnumSqlEvent.eCommand
    End Sub

    Public Sub New(ByVal opname As String, ByVal msg As String)
        Name = opname
        Message = msg
        Type = EnumSqlEvent.eOperation
    End Sub

    Public Sub New(ByVal errcode As UInt32)
        Name = "OpenSqlFilestreamError"
        Message = GetLastErrorMessage(errcode)
        ErrorCode = errcode
        Type = EnumSqlEvent.eOpenSqlFilestreamError
    End Sub
End Class
